package com.own.core.html.form.dropDown;

import java.lang.reflect.Field;

import javax.persistence.Transient;

import org.apache.wicket.IClusterable;
import org.apache.wicket.model.ResourceModel;

import com.own.util.ResourceUtil;

public class DropDownObj implements IClusterable {

	private String name;
	@Transient
	private Field field;

	public DropDownObj() {

	}

	public DropDownObj(String name, Field field) {
		this.name = name;
		this.field = field;

	}

	public Field getField() {
		return field;
	}

	public void setField(Field field) {
		this.field = field;
	}

	public String getName() {
		return name;
	}

	public String getMessage() {
		return ((ResourceModel) ResourceUtil.getResource(field)).getObject();
	}

	public void setName(String name) {
		this.name = name;
	}

	public DropDownObj getDropDownObj() {
		return this;
	}

	public void setDropDownObj(DropDownObj obj) {
		try {
			field = obj.getField();
		} catch (Exception e) {
		}
	}
}
